home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / omega / oguild2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-06  |  22.4 KB  |  758 lines

  1. /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
  2. /* oguild2.c */
  3. /* L_ functions  */ 
  4.  
  5. /* These functions implement the various guilds. */
  6. /* They are all l_ functions since they are basically activated*/
  7. /* at some site or other. */
  8.  
  9. #include "oglob.h"
  10.  
  11.  
  12. void l_thieves_guild()
  13. {
  14.   int fee,count,i,number,done=FALSE,dues=1000;
  15.   char c,action;
  16.   pob lockpick;
  17.   print1("You have penetrated to the Lair of the Thieves' Guild.");
  18.   if (! nighttime()) 
  19.     print2("There aren't any thieves around in the daytime.");
  20.   else {
  21.     if ((Player.rank[THIEVES]==TMASTER) &&
  22.     (Player.level > Shadowlordlevel) &&
  23.     find_and_remove_item(THINGID+16,-1)) {
  24.       print2("You nicked the Justiciar's Badge!");
  25.       morewait();
  26.       print1("The Badge is put in a place of honor in the Guild Hall.");
  27.       print2("You are now the Shadowlord of the Thieves' Guild!");
  28.       morewait();
  29.       print1("Who says there's no honor among thieves?");
  30.       strcpy(Shadowlord,Player.name);
  31.       Shadowlordlevel = Player.level;
  32.       morewait();
  33.       clearmsg();
  34.       print1("You learn the Spell of Shadowform.");
  35.       Spells[S_SHADOWFORM].known = TRUE;
  36.       morewait();
  37.       clearmsg();
  38.       Player.rank[THIEVES]=SHADOWLORD;
  39.       Player.maxagi += 2;
  40.       Player.maxdex += 2;
  41.       Player.agi += 2;
  42.       Player.dex += 2;
  43.     }
  44.     while (! done) {
  45.       menuclear();
  46.       menuprint("a: Join the Thieves' Guild.\n");
  47.       menuprint("b: Raise your Guild rank.\n");
  48.       menuprint("c: Get an item identified.\n");
  49.       if (Player.rank[THIEVES] > 0)
  50.     menuprint("d: Fence an item.\n");
  51.       menuprint("ESCAPE: Leave this Den of Iniquity.");
  52.       action = mgetc();
  53.       if (action == ESCAPE) done = TRUE;
  54.       else if (action == 'a') {
  55.     done = TRUE;
  56.     if (Player.rank[THIEVES]> 0)
  57.       print2("You are already a member!");
  58.     else if (Player.alignment > 10) 
  59.       print2("You are too lawful to be a thief!");
  60.     else {
  61.       dues = (int) (dues * (1+(12-Player.dex)/9.0));
  62.       dues += Player.alignment*5;
  63.       dues = max(100,dues);
  64.       print1("Dues are ");
  65.       mnumprint(dues);
  66.       nprint1("Au. Pay it? [yn] ");
  67.       if (ynq1() =='y') {
  68.         if (Player.cash < dues) {
  69.           print1("You can't cheat the Thieves' Guild!");
  70.           print2("... but the Thieves' Guild can cheat you....");
  71.           Player.cash = 0;
  72.         }
  73.         else {
  74.           print1("Shadowlord ");
  75.           nprint1(Shadowlord);
  76.           print2("enters your name into the roll of the Guild."); 
  77.           morewait();
  78.           clearmsg();
  79.           print1("As a special bonus, you get a free lockpick.");
  80.           print2("You are taught the spell of Object Detection.");
  81.           morewait();
  82.           Spells[S_OBJ_DET].known = TRUE; 
  83.           lockpick = ((pob) malloc(sizeof(objtype)));
  84.           *lockpick = Objects[THINGID+2]; /* lock pick */
  85.           gain_item(lockpick);
  86.           Player.cash -= dues;
  87.           dataprint();
  88.           Player.guildxp[THIEVES]=1;
  89.           Player.rank[THIEVES]=TMEMBER;
  90.           Player.maxdex++;Player.dex++;Player.agi++;Player.maxagi++;
  91.         }
  92.       }
  93.     }
  94.       }
  95.       else if (action == 'b') {
  96.     if (Player.rank[THIEVES]==0)
  97.       print2("You are not even a member!");
  98.     else if (Player.rank[THIEVES]==SHADOWLORD) 
  99.       print2("You can't get any higher than this!");
  100.     else if (Player.rank[THIEVES]==TMASTER) {
  101.       if (Player.level <= Shadowlordlevel)
  102.         print2("You are not experienced enough to advance.");
  103.       else print2("You must bring back the Justiciar's Badge!");
  104.     }
  105.     else if (Player.rank[THIEVES]==THIEF) {
  106.       if (Player.guildxp[THIEVES] < 4000)
  107.         print2("You are not experienced enough to advance.");
  108.       else  {
  109.         print1("You are now a Master Thief of the Guild!");
  110.         print2("You are taught the Spell of Apportation.");
  111.         morewait();
  112.         print1("To advance to the next level you must return with");
  113.         print2("the badge of the Justiciar (cursed be his name).");
  114.         morewait();
  115.         clearmsg();
  116.         print1("The Justiciar's office is just south of the gaol.");
  117.         Spells[S_APPORT].known = TRUE;
  118.         Player.rank[THIEVES]=TMASTER;
  119.         Player.maxagi++;
  120.         Player.maxdex++;
  121.         Player.agi++;
  122.         Player.dex++;
  123.       }
  124.     }
  125.     else if (Player.rank[THIEVES]==ATHIEF) {    
  126.       if (Player.guildxp[THIEVES] < 1500)
  127.         print2("You are not experienced enough to advance.");
  128.       else  {
  129.         print1("You are now a ranking Thief of the Guild!");
  130.         print2("You learn the Spell of Invisibility.");
  131.         Spells[S_INVISIBLE].known = TRUE;
  132.         Player.rank[THIEVES]=THIEF;
  133.         Player.agi++;
  134.         Player.maxagi++;
  135.       }
  136.     }
  137.     else if (Player.rank[THIEVES]==TMEMBER) {
  138.       if (Player.guildxp[THIEVES] < 400)
  139.         print2("You are not experienced enough to advance.");
  140.       else {
  141.         print1("You are now an Apprentice Thief!");
  142.         print2("You are taught the Spell of Levitation.");
  143.         Spells[S_LEVITATE].known = TRUE;
  144.         Player.rank[THIEVES]=ATHIEF;
  145.         Player.dex++;
  146.         Player.maxdex++;
  147.       }
  148.     }
  149.       }
  150.       else if (action == 'c') {
  151.     if (Player.rank[THIEVES]==0) {
  152.       print1("RTG, Inc, Appraisers. Identification Fee: 50Au/item.");
  153.       fee = 50;
  154.     }
  155.     else {
  156.       fee = 5;
  157.       print1("The fee is 5Au per item.");
  158.     }
  159.     print2("Identify one item, or all possessions? [ip] ");
  160.     if (mcigetc()=='i') {
  161.       if (Player.cash < fee)
  162.         print2("Try again when you have the cash.");
  163.       else {
  164.         Player.cash -= fee;
  165.         dataprint();
  166.         identify(0);
  167.       }
  168.     }
  169.     else {
  170.       count = 0;
  171.       for(i=1;i<MAXITEMS;i++)
  172.         if (Player.possessions[i] != NULL)
  173.           if (Player.possessions[i]->known < 2)
  174.         count++;
  175.       for(i=0;i<Player.packptr;i++)
  176.         if (Player.pack[i] != NULL)
  177.           if (Player.pack[i]->known < 2)
  178.         count++;
  179.       print1("The fee will be: ");
  180.       mnumprint(max(count*fee,fee));
  181.       nprint1("Au. Pay it? [yn] ");
  182.       if (ynq1()=='y')
  183.       if (Player.cash < max(count*fee,fee))
  184.         print2("Try again when you have the cash.");
  185.       else {
  186.         Player.cash -= max(count*fee,fee);
  187.         dataprint();
  188.         identify(1);
  189.       }
  190.     }
  191.       }
  192.       else if (action == 'd') {
  193.     if (Player.rank[THIEVES]==0)
  194.       print2("Fence? Who said anything about a fence?");
  195.     else {
  196.       print1("Fence one item or go through pack? [ip] ");
  197.       if (mcigetc()=='i') {
  198.         i = getitem(NULL);
  199.         if ((i==ABORT) || (Player.possessions[i] == NULL))
  200.           print2("Huh, Is this some kind of set-up?");
  201.         else if (Player.possessions[i]->blessing < 0) 
  202.           print2("I don't want to buy a cursed item!");
  203.         else {
  204.           print1("I'll give you ");
  205.           mnumprint(2 * item_value(Player.possessions[i]) / 3);
  206.           nprint1("Au each. OK? [yn] ");
  207.           if (ynq1() == 'y') {
  208.         number = getnumber(Player.possessions[i]->number);
  209.         if ((number >= Player.possessions[i]->number) &&
  210.             Player.possessions[i]->used) {
  211.           Player.possessions[i]->used = FALSE;
  212.           item_use(Player.possessions[i]);
  213.         }
  214.         Player.cash += number*2*item_value(Player.possessions[i])/3;
  215.         dispose_lost_objects(number,Player.possessions[i]);
  216.         dataprint();
  217.           }
  218.           else print2("Hey, gimme a break, it was a fair price!");
  219.         }
  220.       }
  221.       else {
  222.         for(i=0;i<Player.packptr;i++) {
  223.           if (Player.pack[i]->blessing > -1) {
  224.         print1("Sell ");
  225.         nprint1(itemid(Player.pack[i]));
  226.         nprint1(" for ");
  227.         mnumprint(2*item_value(Player.pack[i])/3);
  228.         nprint1("Au each? [ynq] ");
  229.         if ((c=ynq1())=='y') {
  230.           number = getnumber(Player.pack[i]->number);
  231.           Player.cash += 2*number * item_value(Player.pack[i]) / 3;
  232.           Player.pack[i]->number -= number;
  233.           if (Player.pack[i]->number < 1) {
  234.             free((char *)Player.pack[i]);
  235.             Player.pack[i] = NULL;
  236.           }
  237.           dataprint();
  238.         }
  239.         else if (c=='q') break;
  240.           }
  241.         }
  242.         fixpack();
  243.       }
  244.     }
  245.       }
  246.     }
  247.   }
  248.   xredraw();
  249. }
  250.  
  251. void l_college()
  252. {
  253.   char action;
  254.   int done=FALSE,enrolled = FALSE;
  255.   print1("The Collegium Magii. Founded 16937, AOF.");
  256.   if (nighttime())
  257.     print2("The Registration desk is closed at night....");
  258.   else {
  259.     while (! done) {
  260.       if ((Player.rank[COLLEGE]==MAGE) &&
  261.       (Player.level > Archmagelevel) &&
  262.       find_and_remove_item(CORPSEID,ML10+1)) {
  263.     print1("You brought back the heart of the Eater of Magic!");
  264.     morewait();
  265.     print1("The Heart is sent to the labs for analysis.");
  266.     print2("The Board of Trustees appoints you Archmage!");
  267.     morewait();
  268.     clearmsg();
  269.     strcpy(Archmage,Player.name);
  270.     Archmagelevel = Player.level;
  271.     Player.rank[COLLEGE] = ARCHMAGE;
  272.     Player.maxiq += 5;
  273.     Player.iq += 5;
  274.     Player.maxpow += 5;
  275.     Player.pow += 5;
  276.       }
  277.       menuclear();
  278.       menuprint("May we help you?\n\n");
  279.       menuprint("a: Enroll in the College.\n");
  280.       menuprint("b: Raise your College rank.\n");
  281.       menuprint("c: Do spell research.\n");
  282.       menuprint("ESCAPE: Leave these hallowed halls.\n");
  283.       action = mgetc();
  284.       if (action == ESCAPE) done = TRUE;
  285.       else if (action == 'a') {
  286.     if (Player.rank[COLLEGE] > 0)
  287.       print2("You are already enrolled!");
  288.     else if (Player.iq < 13) 
  289.       print2("Your low IQ renders you incapable of being educated.");
  290.     else {
  291.       if (Player.iq > 17) {
  292.         print2("You are given a scholarship!");
  293.         morewait();
  294.         enrolled=TRUE;
  295.       }
  296.       else {
  297.         print1("Tuition is 1000Au. ");
  298.         nprint1("Pay it? [yn] ");
  299.         if (ynq1() =='y') {
  300.           if (Player.cash < 1000)
  301.         print2("You don't have the funds!");
  302.           else {
  303.         Player.cash -= 1000;
  304.         enrolled = TRUE;
  305.         dataprint();
  306.           }        
  307.         }
  308.       }
  309.       if (enrolled) {
  310.         print1("Archmage ");
  311.         nprint1(Archmage);
  312.         nprint1(" greets you and congratulates you on your acceptance.");
  313.         print2("You are now enrolled in the Collegium Magii!");
  314.         morewait();
  315.         print1("You are now a Novice.");
  316.         print2("You may research 1 spell, for your intro class.");
  317.         Spellsleft = 1;
  318.         Player.rank[COLLEGE] = INITIATE;
  319.         Player.guildxp[COLLEGE] = 1;
  320.         Player.maxiq += 1;
  321.         Player.iq += 1;
  322.         Player.maxpow += 1;
  323.         Player.pow += 1;
  324.       }
  325.     }
  326.       }
  327.       else if (action == 'b') {
  328.     if (Player.rank[COLLEGE] == 0)
  329.       print2("You have not even been initiated, yet!");
  330.     else if (Player.rank[COLLEGE]==ARCHMAGE) 
  331.       print2("You are at the pinnacle of mastery in the Collegium.");
  332.     else if (Player.rank[COLLEGE]==MAGE) {
  333.       if (Player.level <= Archmagelevel)
  334.         print2("You are not experienced enough to advance.");
  335.       else
  336.         print2("You must return with the heart of the Eater of Magic!");
  337.     }
  338.     else if (Player.rank[COLLEGE]==PRECEPTOR) {
  339.       if (Player.guildxp[COLLEGE] < 4000)
  340.         print2("You are not experienced enough to advance.");
  341.       else  {
  342.         print1("You are now a Mage of the Collegium Magii!");
  343.         print2("You may research 6 spells for postdoctoral research.");
  344.         Spellsleft += 6;
  345.         morewait();
  346.         print1("To become Archmage, you must return with the");
  347.         print2("heart of the Eater of Magic");
  348.         morewait();
  349.         clearmsg();
  350.         print1("The Eater may be found on a desert isle somewhere.");
  351.         Player.rank[COLLEGE] = MAGE;
  352.         Player.maxiq += 2;
  353.         Player.iq += 2;
  354.         Player.maxpow += 2;
  355.         Player.pow += 2;
  356.       }
  357.     }
  358.     else if (Player.rank[COLLEGE]==STUDENT) {
  359.       if (Player.guildxp[COLLEGE] < 1500)
  360.         print2("You are not experienced enough to advance.");
  361.       else  {
  362.         print1("You are now a Preceptor of the Collegium Magii!");
  363.         print2("You are taught the basics of ritual magic.");
  364.         morewait();
  365.         clearmsg();
  366.         print1("Your position allows you to research 4 spells.");
  367.         Spellsleft +=4;
  368.         Spells[S_RITUAL].known = TRUE;
  369.         Player.rank[COLLEGE] = PRECEPTOR;
  370.         Player.maxiq += 1;
  371.         Player.iq += 1;
  372.         Player.maxpow += 1;
  373.         Player.pow += 1;
  374.       }
  375.     }
  376.     else if (Player.rank[COLLEGE]==NOVICE) {
  377.       if (Player.guildxp[COLLEGE] < 400)
  378.         print2("You are not experienced enough to advance.");
  379.       else  {
  380.         print1("You are now a Student at the Collegium Magii!");
  381.         print2("You are taught the spell of identification.");
  382.         morewait();
  383.         clearmsg();
  384.         print1("Thesis research credit is 2 spells.");
  385.         Spellsleft+=2;
  386.         Spells[S_IDENTIFY].known = TRUE;
  387.         Player.rank[COLLEGE] = STUDENT;
  388.         Player.maxiq += 1;
  389.         Player.iq += 1;
  390.         Player.maxpow += 1;
  391.         Player.pow += 1;
  392.       }
  393.     }
  394.       }
  395.       else if (action == 'c') {
  396.     clearmsg();
  397.     if (Spellsleft > 0) {
  398.       print1("Research permitted: ");
  399.       mnumprint(Spellsleft);
  400.       nprint1(" Spells.");
  401.       morewait();
  402.     }
  403.     if (Spellsleft < 1) {
  404.       print1("Extracurricular Lab fee: 2000 Au. ");
  405.       nprint1("Pay it? [yn] ");
  406.       if (ynq1()=='y') {
  407.         if (Player.cash < 2000) 
  408.           print1("Try again when you have the cash.");
  409.         else {
  410.           Player.cash -= 2000;
  411.           dataprint();
  412.           Spellsleft = 1;
  413.         }
  414.       }
  415.     }
  416.     if (Spellsleft > 0) {
  417.       learnspell(0);
  418.       Spellsleft--;
  419.     }
  420.       }
  421.     }
  422.   }
  423.   xredraw();
  424. }
  425.  
  426.  
  427.  
  428. void l_sorcerors()
  429. {
  430.   char action;
  431.   int done=FALSE,fee=3000,total;
  432.   print1("The Circle of Sorcerors.");
  433.   if (Player.rank[CIRCLE] == -1) {
  434.     print2("Fool! Didn't we tell you to go away?");
  435.     Player.mana = 0;
  436.     dataprint();
  437.   }
  438.   else  while (! done) {
  439.     if ((Player.rank[CIRCLE]==HIGHSORCEROR) &&
  440.     (Player.level > Primelevel) &&
  441.     find_and_remove_item(CORPSEID,ML10+2)) {
  442.       print2("You obtained the Crown of the Lawgiver!");
  443.       morewait();
  444.       print1("The Crown is ritually sacrificed to the Lords of Chaos.");
  445.       print2("You are now the Prime Sorceror of the Inner Circle!");
  446.       strcpy(Prime,Player.name);
  447.       Primelevel = Player.level;
  448.       morewait();
  449.       clearmsg();
  450.       print1("You learn the Spell of Disintegration!");
  451.       morewait();
  452.       clearmsg();
  453.       Spells[S_DISINTEGRATE].known = TRUE;
  454.       Player.rank[CIRCLE] = PRIME;
  455.       Player.maxpow += 10;
  456.       Player.pow += 10;
  457.     }
  458.     menuclear();
  459.     menuprint("May we help you?\n\n");
  460.     menuprint("a: Become an Initiate of the Circle.\n");
  461.     menuprint("b: Raise your rank in the Circle.\n");
  462.     menuprint("c: Restore mana points\n");
  463.     menuprint("ESCAPE: Leave these Chambers of Power.\n");
  464.     action = mgetc();
  465.     if (action == ESCAPE) done = TRUE;
  466.     else if (action == 'a') {
  467.       if (Player.rank[CIRCLE] > 0)
  468.       print2("You are already an initiate!");
  469.       else if (Player.alignment > 0)
  470.     print2("You may not join -- you reek of Law!");
  471.       else {
  472.     fee += Player.alignment*100;
  473.     fee = (int) (fee * (1+(12-Player.pow)/9.0));
  474.     fee = max(100,fee);
  475.     print1("For you, there is an initiation fee of ");
  476.     mnumprint(fee);
  477.     nprint1("Au.");
  478.     print2("Pay it? [yn] ");
  479.     if (ynq2() =='y') {
  480.       if (Player.cash < fee) 
  481.         print3("Try again when you have the cash!");
  482.       else {
  483.         print1("Prime Sorceror ");
  484.         nprint1(Prime);
  485.         print2("conducts your initiation into the circle of novices.");
  486.         morewait();
  487.         clearmsg();
  488.         print1("You learn the Spell of Magic Missiles.");
  489.         Spells[S_MISSILE].known = TRUE;
  490.         Player.cash -= fee;
  491.         dataprint();
  492.         Player.rank[CIRCLE] = INITIATE;
  493.         Player.guildxp[CIRCLE] = 1;
  494.         Player.maxpow++;
  495.         Player.pow++;
  496.       }
  497.     }
  498.       }
  499.     }
  500.     else if (action == 'b') {
  501.       if (Player.rank[CIRCLE] == 0)
  502.     print2("You have not even been initiated, yet!");
  503.       else if (Player.alignment > -1) {
  504.     print1("Ahh! You have grown too lawful!!!");
  505.     print2("You are hereby blackballed from the Circle!");
  506.     Player.rank[CIRCLE] = -1;
  507.     morewait();
  508.     clearmsg();
  509.     print1("A pox upon thee!");
  510.     if (! Player.immunity[INFECTION])
  511.       Player.status[DISEASED]+=100;
  512.     print2("And a curse on your possessions!");
  513.     morewait();
  514.     clearmsg();
  515.     acquire(-1);
  516.     clearmsg();
  517.     enchant(-1);
  518.     bless(-1);
  519.     print3("Die, false sorceror!");
  520.     p_damage(25,UNSTOPPABLE,"a sorceror's curse");
  521.       }
  522.       else if (Player.rank[CIRCLE]==PRIME) 
  523.     print2("You are at the pinnacle of mastery in the Circle.");
  524.       else if (Player.rank[CIRCLE]==HIGHSORCEROR) {
  525.     if (Player.level <= Primelevel)
  526.       print2("You are not experienced enough to advance.");
  527.     else 
  528.       print2("You must return with the Crown of the LawBringer!");
  529.       }
  530.       else if (Player.rank[CIRCLE]==SORCEROR) {
  531.     if (Player.guildxp[CIRCLE] < 4000)
  532.       print2("You are not experienced enough to advance.");
  533.     else  {
  534.       print1("You are now a High Sorceror of the Inner Circle!");
  535.       print2("You learn the Spell of Disruption!");
  536.       morewait();
  537.       clearmsg();
  538.       print1("To advance you must return with the LawBringer's Crown!");
  539.       print2("The LawBringer resides on Star Peak.");
  540.       Spells[S_DISRUPT].known = TRUE;
  541.       Player.rank[CIRCLE] = HIGHSORCEROR;
  542.       Player.maxpow += 5;
  543.       Player.pow += 5;
  544.     }
  545.       }
  546.       else if (Player.rank[CIRCLE]==ENCHANTER) {
  547.     if (Player.guildxp[CIRCLE] < 1500)
  548.       print2("You are not experienced enough to advance.");
  549.     else  {
  550.       print1("You are now a member of the Circle of Sorcerors!");
  551.       print2("You learn the Spell of Ball Lightning!");
  552.       Spells[S_LBALL].known = TRUE;
  553.       Player.rank[CIRCLE] = SORCEROR;
  554.       Player.maxpow += 2; 
  555.       Player.pow+=2;
  556.     }
  557.       }
  558.       else if (Player.rank[CIRCLE]==INITIATE) {
  559.     if (Player.guildxp[CIRCLE] < 400)
  560.       print2("You are not experienced enough to advance.");
  561.     else  {
  562.       print1("You are now a member of the Circle of Enchanters!");
  563.       print2("You learn the Spell of Firebolts.");
  564.       Spells[S_FIREBOLT].known = TRUE;
  565.       Player.rank[CIRCLE] = ENCHANTER;
  566.       Player.maxpow++;
  567.       Player.pow++;
  568.     }
  569.       }
  570.     }
  571.     else if (action == 'c') {
  572.       done = TRUE;
  573.       fee = Player.level*100;
  574.       if (Player.rank[CIRCLE]) fee = fee / 2;
  575.       print1("That will be: ");
  576.       mnumprint(fee);
  577.       nprint1("Au. Pay it? [yn] ");
  578.       if (ynq1()=='y') {
  579.     if (Player.cash < fee) 
  580.       print2("Begone, deadbeat, or face the wrath of the Circle!");
  581.     else {
  582.       Player.cash -= fee;
  583.       total = calcmana();
  584.       while (Player.mana < total) {
  585.         Player.mana++;
  586.         dataprint();
  587.       }
  588.       print2("Have a sorcerous day, now!");
  589.     }
  590.       }
  591.       else print2("Be seeing you!");
  592.     }
  593.   }
  594.   xredraw();
  595. }
  596.  
  597.  
  598.  
  599.  
  600. void l_order()
  601. {
  602.   pob newitem;
  603.   print1("The Headquarters of the Order of Paladins.");
  604.   morewait();
  605.   if ((Player.rank[ORDER]==PALADIN) &&
  606.       (Player.level > Justiciarlevel) &&
  607.       gamestatusp(GAVE_STARGEM) &&
  608.       Player.alignment > 300) {
  609.     print1("You have succeeded in your quest!");
  610.     morewait();
  611.     print1("The previous Justiciar steps down in your favor.");
  612.     print2("You are now the Justiciar of Rampart and the Order!");
  613.     strcpy(Justiciar,Player.name);
  614.     Justiciarlevel = Player.level;
  615.     morewait();
  616.     clearmsg();
  617.     print1("You are awarded a blessed shield of deflection!");
  618.     morewait();
  619.     newitem = ((pob) malloc(sizeof(objtype)));
  620.     *newitem = Objects[SHIELDID+6]; /* shield of deflection */
  621.     newitem->blessing = 9;
  622.     gain_item(newitem);
  623.     morewait();
  624.     Player.rank[ORDER] = PRIME;
  625.     Player.maxpow += 10;
  626.     Player.pow += 10;
  627.   }
  628.   if ((Player.rank[ORDER] == -1) || (Player.alignment < 1)) 
  629.     print1("Get thee hence, minion of chaos!");
  630.   else if (Player.rank[ORDER] == 0) {
  631.     if (Player.rank[ARENA] != 0) 
  632.       print1("We do not accept blood stained gladiators into our Order.");
  633.     else if (Player.rank[LEGION] != 0) 
  634.       print1("Go back to your barracks, mercenary!");
  635.     else {
  636.       print1("Dost thou wish to join our Order? [yn] ");
  637.       if (ynq1()=='y') {
  638.     print1("Justiciar ");
  639.     nprint1(Justiciar);
  640.     nprint1(" welcomes you to the Order.");
  641.     print2("'Mayest thou always follow the sublime path of Law.'");
  642.     morewait();
  643.     print1("You are now a Gallant in the Order.");
  644.     print2("You are given a horse and a blessed spear.");
  645.     morewait();
  646.     Player.rank[ORDER] = GALLANT;
  647.     Player.guildxp[ORDER] = 1;
  648.     setgamestatus(MOUNTED);
  649.     newitem = ((pob) malloc(sizeof(objtype)));
  650.     *newitem = Objects[WEAPONID+19]; /* spear */
  651.     newitem->blessing = 9;
  652.     newitem->plus = 1;
  653.     newitem->known = 2;
  654.     gain_item(newitem);
  655.       }
  656.     }
  657.   }
  658.   else {
  659.     if (Player.alignment < 1) {
  660.       print1("You have been tainted by chaos!");
  661.       print2("You are stripped of your rank in the Order!");
  662.       morewait();
  663.       Player.rank[ORDER]= -1;
  664.       send_to_jail();
  665.     }
  666.     else {
  667.       print1("'Welcome back, Paladin.'");
  668.       if (!gamestatusp(MOUNTED)) {
  669.     print2("You are given a new steed.");
  670.     setgamestatus(MOUNTED);
  671.       }
  672.       morewait();
  673.       clearmsg();
  674.       if ((Player.hp < Player.maxhp) || (Player.status[DISEASED]))
  675.     print1("Your wounds are treated by a medic.");
  676.       cleanse(1);
  677.       Player.hp = Player.maxhp;
  678.       Player.food = 40;
  679.       print2("You get a hot meal from the refectory.");
  680.       morewait();
  681.       clearmsg();
  682.       if (Player.rank[ORDER]==PALADIN) {
  683.     if (Player.level <= Justiciarlevel)
  684.       print2("You are not experienced enough to advance.");
  685.     else if (Player.alignment < 300)
  686.       print2("You are not sufficiently Lawful as yet to advance.");
  687.     else print2("You must give the Star Gem to the LawBringer.");
  688.       }
  689.       else if (Player.rank[ORDER]==CHEVALIER) {
  690.     if (Player.guildxp[ORDER] < 4000)
  691.       print2("You are not experienced enough to advance.");
  692.     else if (Player.alignment < 200)
  693.       print2("You are not sufficiently Lawful as yet to advance.");
  694.     else {
  695.       print1("You are made a Paladin of the Order!");
  696.       print2("You learn the Spell of Heroism and get Mithril Plate!");
  697.       morewait();
  698.       newitem = ((pob) malloc(sizeof(objtype)));
  699.       *newitem = Objects[ARMORID+11]; /* mithril plate armor */
  700.       newitem->blessing = 9;
  701.       newitem->known = 2;
  702.       gain_item(newitem);
  703.       morewait();
  704.       clearmsg();
  705.       print1("To advance you must rescue the Star Gem and return it");
  706.       print2("to its owner, the LawBringer, who resides on Star Peak.");
  707.       morewait();
  708.       print1("The Star Gem was stolen by the cursed Prime Sorceror,");
  709.       print2("whose headquarters may be found beyond the Astral Plane.");
  710.       morewait();
  711.       print1("The Oracle will send you to the Astral Plane if you");
  712.       print2("prove yourself worthy to her.");
  713.       morewait();
  714.       Spells[S_HERO].known = TRUE;
  715.       Player.rank[ORDER] = PALADIN;
  716.     }
  717.       }
  718.       else if (Player.rank[ORDER]==GUARDIAN) {
  719.     if (Player.guildxp[ORDER] < 1500)
  720.       print2("You are not experienced enough to advance.");
  721.     else if (Player.alignment < 125)
  722.       print2("You are not yet sufficiently Lawful to advance.");
  723.     else {
  724.       Player.rank[ORDER] = CHEVALIER;
  725.       print1("You are made a Chevalier of the Order!");
  726.       print2("You are given a Mace of Disruption!");
  727.       morewait();
  728.       clearmsg();
  729.       newitem = ((pob) malloc(sizeof(objtype)));
  730.       *newitem = Objects[WEAPONID+25]; /* mace of disruption */
  731.       newitem->known = 2;
  732.       gain_item(newitem);
  733.     }
  734.       }
  735.       else if (Player.rank[ORDER]==GALLANT) {
  736.     if (Player.guildxp[ORDER] < 400)
  737.       print2("You are not experienced enough to advance.");
  738.     else if (Player.alignment < 50)
  739.       print2("You are not Lawful enough to advance.");
  740.     else  {
  741.       print1("You are made a Guardian of the Order of Paladins!");
  742.       print2("You are given a Holy Hand Grenade (of Antioch).");
  743.       morewait();
  744.       print1("You hear a nasal monotone in the distance....");
  745.       print2("'...and the number of thy counting shall be 3...'");
  746.       morewait();
  747.       clearmsg();
  748.       Player.rank[ORDER] = GUARDIAN;
  749.       newitem = ((pob) malloc(sizeof(objtype)));
  750.       *newitem = Objects[ARTIFACTID+7]; /* holy hand grenade. */
  751.       newitem->known = 2;
  752.       gain_item(newitem);
  753.     }
  754.       }
  755.     }
  756.   }
  757. }
  758.